<template>
  <div class="home">个人中心</div>
</template>

<script>
import store from "@/store";
export default {
  beforeRouteEnter(to, from, next) {
    let token = localStorage.getItem("x-auth-token");
    if (token) {
      next();
    } else {
      store.dispatch("ShowToast/asyncToast", {
        showToast: true,
        text: "登录后才能访问哦~(组件守卫)",
        type: "danger",
      });
    }
  },
};
</script>
